package com.mg.smarttask.server;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class UserDO {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;

	@Persistent
	private String nom;
	
	@Persistent
	private String username;
	
	@Persistent
	private String prenom;
	
	@Persistent
	private String eMail;
	
	@Persistent
	private String passWord;
	
	@Persistent
	private String cp;
	
	@Persistent
	private Date registerDate;
	
	public UserDO(){
		registerDate = new Date();
	}
	/**
	 * Constructeur
	 * @param userName
	 * @param nom
	 * @param prenom
	 * @param eMail
	 * @param passWord
	 * @param cp
	 */
	public UserDO(String userName, String nom, String prenom, String eMail, String passWord, String cp){
		this.nom = nom;
		this.prenom = prenom;
		this.username = userName;
		this.eMail = eMail;
		this.cp = cp;
		this.passWord = passWord;
		registerDate = new Date();
	}
		
	public long getId(){
		return id.getId();
	}
	public String getNom(){
		return nom;
	}
	public String getPrenom(){
		return prenom;
	}
	public String getEMail(){
		return eMail;
	}
	public String getPassWord(){
		return passWord;
	}
	public String getCp(){
		return cp;
	}
	public Date getregisterDate(){
		return registerDate;
	}
	public void setNom(String nom){
		this.nom = nom;
	}
	public String getUsername(){
		return username;
	}
	public void setUserame(String username){
		this.username = username;
	}
	public void setPrenom(String prenom){
		this.prenom = prenom;
	}
	public void setPassWord(String passWord){
		this.passWord = passWord;
	}
	public void setCp(String cp){
		this.cp = cp;
	}
	public void setRegisterDate(Date registerDate ){
		this.registerDate = registerDate;
	}
	public void setEMail(String eMail){
		this.eMail = eMail;
	}

	
}
